package be.idamf.mx.rpc
{
	import be.idamf.flash.exec.deferExec;
	
	import mx.core.mx_internal;
	import mx.messaging.messages.IMessage;
	import mx.rpc.AsyncToken;
	import mx.rpc.Fault;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	
	public class MockAsyncToken extends AsyncToken
	{
		use namespace mx_internal;
		
		public function MockAsyncToken(message:IMessage = null)
		{
			super(message);
		}
		
		public function asyncResult(result:Object):void
		{
			deferExec(this, applyResult, true, ResultEvent.createEvent(result, this, message));
		}
		
		public function asyncFault(fault:Fault):void
		{
			deferExec(this, applyFault, true, FaultEvent.createEvent(fault, this, message));
		}
	}
}